<?xml version="1.0" encoding="utf-8"?>
<WITD application="Work item type editor" version="1.0">
  <WORKITEMTYPE name="Buddy Build">
    <DESCRIPTION>Create a request for code to be reviewed from a shelveset</DESCRIPTION>
    <FIELDS>
      <FIELD reportable="dimension" type="String" name="Title" refname="System.Title">
        <HELPTEXT>Name of the shelfset and owner</HELPTEXT>
        <REQUIRED />
      </FIELD>
      <FIELD reportable="dimension" type="String" name="State" refname="System.State">
        <HELPTEXT>Status of this issue</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="Integer" name="Rev" refname="System.Rev">
        <HELPTEXT>Revision number of object. Starts at one.</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Changed By" refname="System.ChangedBy">
        <HELPTEXT>Person who last changed this item</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="DateTime" name="Resolved Date" refname="Microsoft.VSTS.Common.ResolvedDate">
        <HELPTEXT>Date this item was resolved</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Reason" refname="System.Reason" />
      <FIELD reportable="dimension" type="String" name="Resolved By" refname="Microsoft.VSTS.Common.ResolvedBy">
        <HELPTEXT>Person who resolved this item</HELPTEXT>
        <ALLOWEXISTINGVALUE />
        <VALIDUSER />
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Assigned To" refname="System.AssignedTo">
        <HELPTEXT>Person currently responsible for this item</HELPTEXT>
        <REQUIRED />
        <ALLOWEXISTINGVALUE />
        <VALIDUSER />
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Work Item Type" refname="System.WorkItemType" />
      <FIELD reportable="dimension" type="String" name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy">
        <HELPTEXT>Person who closed this item</HELPTEXT>
        <VALIDUSER />
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD reportable="dimension" type="DateTime" name="Created Date" refname="System.CreatedDate">
        <HELPTEXT>Date this item was opened</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Created By" refname="System.CreatedBy">
        <HELPTEXT>Person who opened this item</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="DateTime" name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate">
        <HELPTEXT>Date this item was closed</HELPTEXT>
      </FIELD>
      <FIELD type="History" name="History" refname="System.History">
        <HELPTEXT>Discussion thread and other historical information</HELPTEXT>
      </FIELD>
      <FIELD type="Integer" name="RelatedLinkCount" refname="System.RelatedLinkCount">
        <HELPTEXT>Count of related items</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Resolution" refname="Microsoft.VSTS.Dogfood.Resolution">
        <HELPTEXT>Resolution of this item</HELPTEXT>
        <ALLOWEDVALUES>
          <LISTITEM value="Approved" />
          <LISTITEM value="Rejected" />
          <LISTITEM value="Deleted" />
        </ALLOWEDVALUES>
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD reportable="dimension" type="TreePath" name="Iteration Path" refname="System.IterationPath" />
      <FIELD type="Integer" name="IterationID" refname="System.IterationId" />
      <FIELD reportable="measure" type="Integer" name="ExternalLinkCount" refname="System.ExternalLinkCount" />
      <FIELD reportable="dimension" type="String" name="Team Project" refname="System.TeamProject" />
      <FIELD type="DateTime" name="Fix Date (MSCOM)" refname="Microsoft.MSCOM.Common.FixDate">
        <HELPTEXT>This is the target date for the bug to be fixed.</HELPTEXT>
      </FIELD>
      <FIELD type="String" name="Fix By (MSCOM)" refname="Microsoft.MSCOM.Common.FixBy">
        <HELPTEXT>Indicates when the bug must be fixed.</HELPTEXT>
      </FIELD>
      <FIELD reportable="measure" type="Integer" name="HyperLinkCount" refname="System.HyperLinkCount">
        <HELPTEXT>Count of linked files</HELPTEXT>
      </FIELD>
      <FIELD reportable="measure" type="Integer" name="AttachedFileCount" refname="System.AttachedFileCount">
        <HELPTEXT>Count of attached files</HELPTEXT>
      </FIELD>
      <FIELD type="String" name="Node Name" refname="System.NodeName" />
      <FIELD reportable="dimension" type="TreePath" name="Area Path" refname="System.AreaPath">
        <HELPTEXT>Hierarchy location of this item</HELPTEXT>
      </FIELD>
      <FIELD type="DateTime" name="Revised Date" refname="System.RevisedDate">
        <HELPTEXT>Date this version was replaced.</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="DateTime" name="Changed Date" refname="System.ChangedDate">
        <HELPTEXT>Date this item was last changed</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="Integer" name="ID" refname="System.Id">
        <HELPTEXT>Unique ID for item instance</HELPTEXT>
      </FIELD>
      <FIELD type="Integer" name="AreaID" refname="System.AreaId">
        <HELPTEXT>Locates object in hierarchy</HELPTEXT>
      </FIELD>
      <FIELD type="String" name="Authorized As" refname="System.AuthorizedAs">
        <HELPTEXT>Domain Account Name of person who changed this object.</HELPTEXT>
      </FIELD>
      <FIELD type="PlainText" name="BuddyBuildComments" refname="Tbpt.BuddyBuild.Comments" />
      <FIELD reportable="dimension" type="String" name="Shelveset Name" refname="Tbpt.ShelvesetName">
        <HELPTEXT>Name of the shelveset to be buddy built</HELPTEXT>
      </FIELD>
      <FIELD reportable="dimension" type="String" name="Shelveset Owner" refname="Tbpt.ShelvesetOwner">
        <HELPTEXT>Name of the shelveset owner</HELPTEXT>
      </FIELD>
    </FIELDS>
      <WORKFLOW>
          <STATES>
              <STATE value="Active">
                  <FIELDS>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                          <ALLOWEXISTINGVALUE />
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
                          <ALLOWEXISTINGVALUE />
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Dogfood.Resolution">
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="System.AssignedTo">
                          <ALLOWEXISTINGVALUE />
                      </FIELD>
                  </FIELDS>
              </STATE>
              <STATE value="Resolved">
                  <FIELDS>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                          <ALLOWEXISTINGVALUE />
                          <EMPTY />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
                          <REQUIRED />
                          <ALLOWEXISTINGVALUE />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
                          <REQUIRED />
                      </FIELD>
                      <FIELD refname="System.AssignedTo">
                          <ALLOWEXISTINGVALUE />
                      </FIELD>
                  </FIELDS>
              </STATE>
              <STATE value="Closed">
                  <FIELDS>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                          <ALLOWEXISTINGVALUE />
                          <REQUIRED />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                          <REQUIRED />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
                          <REQUIRED />
                          <READONLY />
                          <ALLOWEXISTINGVALUE />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
                          <REQUIRED />
                          <READONLY />
                      </FIELD>
                      <FIELD refname="System.AssignedTo">
                          <ALLOWEXISTINGVALUE />
                          <ALLOWEDVALUES filteritems="excludegroups">
                              <LISTITEM value="Closed" />
                              <LISTITEM value="[project]\Contributors" />
                              <LISTITEM value="[project]\Project Administrators" />
                          </ALLOWEDVALUES>
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Dogfood.Resolution">
                          <ALLOWEDVALUES>
                              <LISTITEM value="Approved" />
                              <LISTITEM value="Deleted" />
                          </ALLOWEDVALUES>
                      </FIELD>
                  </FIELDS>
              </STATE>
          </STATES>
          <TRANSITIONS>
              <TRANSITION from="" to="Active">
                  <REASONS>
                      <DEFAULTREASON value="New" />
                  </REASONS>
                  <FIELDS>
                      <FIELD refname="System.AssignedTo">
                          <COPY from="currentuser" />
                      </FIELD>
                  </FIELDS>
              </TRANSITION>
              <TRANSITION from="Active" to="Resolved">
                  <ACTIONS>
                      <ACTION value="Microsoft.VSTS.Actions.Checkin" />
                  </ACTIONS>
                  <REASONS>
                      <DEFAULTREASON value="Resolve" />
                  </REASONS>
                  <FIELDS>
                      <FIELD refname="System.AssignedTo">
                          <COPY from="field" field="System.CreatedBy" />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
                          <COPY from="currentuser" />
                          <VALIDUSER />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
                          <COPY from="clock" />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Dogfood.Resolution">
                          <COPY from="value" value="Rejected" />
                      </FIELD>
                  </FIELDS>
              </TRANSITION>
              <TRANSITION from="Resolved" to="Active">
                  <REASONS>
                      <DEFAULTREASON value="Reactivate" />
                  </REASONS>
                  <FIELDS>
                      <FIELD refname="System.AssignedTo">
                          <COPY from="field" field="Microsoft.VSTS.Common.ResolvedBy" />
                      </FIELD>
                  </FIELDS>
              </TRANSITION>
              <TRANSITION from="Resolved" to="Closed">
                  <REASONS>
                      <DEFAULTREASON value="Close" />
                  </REASONS>
                  <FIELDS>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                          <COPY from="currentuser" />
                      </FIELD>
                      <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                          <COPY from="clock" />
                      </FIELD>
                      <FIELD refname="System.AssignedTo">
                          <ALLOWEXISTINGVALUE />
                          <COPY from="currentuser" />
                          <VALIDUSER />
                      </FIELD>
                  </FIELDS>
              </TRANSITION>
              <TRANSITION from="Closed" to="Active">
                  <REASONS>
                      <DEFAULTREASON value="Regression" />
                  </REASONS>
                  <FIELDS>
                      <FIELD refname="System.AssignedTo">
                          <COPY from="field" field="Microsoft.VSTS.Common.ResolvedBy" />
                      </FIELD>
                  </FIELDS>
              </TRANSITION>
          </TRANSITIONS>
      </WORKFLOW>
      <FORM>
      <Layout>
        <Group>
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" Label="Title" LabelPosition="Left" />
          </Column>
        </Group>
        <Group Label="Shelveset">
          <Column PercentWidth="100">
            <Control FieldName="Tbpt.ShelvesetName" Type="FieldControl" Label="Shelveset Name" LabelPosition="Left" />
          </Column>
          <Column PercentWidth="100">
            <Control FieldName="Tbpt.ShelvesetOwner" Type="FieldControl" Label="Shelveset Owner" LabelPosition="Left" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="100">
            <Group Label="Classification">
              <Column PercentWidth="100">
                <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="Path" LabelPosition="Left" />
                <Control Type="WorkItemClassificationControl" Label="Release\Iteration" LabelPosition="Left" Fieldname="System.IterationPath" />
              </Column>
            </Group>
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="50">
            <Group Label="Status">
              <Column PercentWidth="100">
                <Control FieldName="System.State" Type="FieldControl" Label="Status" LabelPosition="Left" />
                <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Assigned to" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="50">
            <Group Label="Resolved">
              <Column PercentWidth="100">
                <Control FieldName="Microsoft.VSTS.Common.ResolvedDate" Type="FieldControl" Label="Date" LabelPosition="Left" />
                <Control FieldName="Microsoft.VSTS.Common.ResolvedBy" Type="FieldControl" Label="By" LabelPosition="Left" />
                <Control FieldName="Microsoft.VSTS.Dogfood.Resolution" Type="FieldControl" Label="Resolution" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Buddy Build Comments">
            <Control FieldName="Tbpt.BuddyBuild.Comments" Type="HtmlFieldControl" Label="" LabelPosition="Right" />
          </Tab>
          <Tab Label="History">
            <Control FieldName="System.History" Type="WorkItemLogControl" Label="&amp;History:" LabelPosition="Top" Dock="Fill" />
          </Tab>
          <Tab Label="Links">
            <Control Type="LinksControl" LabelPosition="Top" />
          </Tab>
          <Tab Label="File Attachments">
            <Control Type="AttachmentsControl" LabelPosition="Top" />
          </Tab>
          <Tab Label="Details">
            <Group>
              <Column PercentWidth="50">
                <Group Label="Opened">
                  <Column PercentWidth="100">
                    <Control FieldName="System.CreatedDate" Type="FieldControl" Label="Date" LabelPosition="Left" />
                    <Control FieldName="System.CreatedBy" Type="FieldControl" Label="By" LabelPosition="Left" />
                  </Column>
                </Group>
              </Column>
              <Column PercentWidth="50">
                <Group Label="Closed">
                  <Column PercentWidth="100">
                    <Control FieldName="Microsoft.VSTS.Common.ClosedDate" Type="FieldControl" Label="Date" LabelPosition="Left" />
                    <Control FieldName="Microsoft.VSTS.Common.ClosedBy" Type="FieldControl" Label="By" LabelPosition="Left" />
                  </Column>
                </Group>
              </Column>
            </Group>
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</WITD>